/**
 * 
 */
package domain;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @author yfekih
 *
 */


@Entity
@Table(name = "TB_utilisateur")
public class Utilisateur implements Serializable {

	public Utilisateur(){
		
	}
	public Utilisateur(String nom, String prenom, String mdp,
			String fonction, String societe, Set<Flotte> flottes) {
		this.nom = nom;
		this.prenom = prenom;
		this.mdp = mdp;
		this.fonction = fonction;
		this.societe = societe;
		this.flottes = flottes;
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = -5169150462769000016L;
	
	public final static String ID_UTILISATEUR = "ID_UTILISATEUR";
	
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID")
	private Long id;
	
	
	@Column(name="NOM")
	private String nom;

	@Column(name="PRENOM")
	private String prenom;
	
	@Column(name="MDP")
	private String mdp;
	
	@Column(name="FONCTION")
	private String fonction;
	
	@Column(name="SOCIETE")
	private String societe;
	
	@OneToMany(fetch= FetchType.EAGER, targetEntity = Flotte.class, mappedBy= Flotte.UTILISATEUR_MAPPING_NAME)
	private Set<Flotte> flottes;

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the nom
	 */
	public String getNom() {
		return nom;
	}

	/**
	 * @param nom the nom to set
	 */
	public void setNom(String nom) {
		this.nom = nom;
	}

	/**
	 * @return the prenom
	 */
	public String getPrenom() {
		return prenom;
	}

	/**
	 * @param prenom the prenom to set
	 */
	public void setPrenom(String prenom) {
		this.prenom = prenom;
	}

	/**
	 * @return the mdp
	 */
	public String getMdp() {
		return mdp;
	}

	/**
	 * @param mdp the mdp to set
	 */
	public void setMdp(String mdp) {
		this.mdp = mdp;
	}

	/**
	 * @return the fonction
	 */
	public String getFonction() {
		return fonction;
	}

	/**
	 * @param fonction the fonction to set
	 */
	public void setFonction(String fonction) {
		this.fonction = fonction;
	}

	/**
	 * @return the societe
	 */
	public String getSociete() {
		return societe;
	}

	/**
	 * @param societe the societe to set
	 */
	public void setSociete(String societe) {
		this.societe = societe;
	}

	/**
	 * @return the flottes
	 */
	public Set<Flotte> getFlottes() {
		return flottes;
	}

	/**
	 * @param flottes the flottes to set
	 */
	public void setFlottes(Set<Flotte> flottes) {
		this.flottes = flottes;
	}


}
